﻿using ServiceStack;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PuSuoPai;

namespace TeZhanDui
{
    public enum ROOM_CMD
    {
        GET_ROOM_STATE,
        SET_USR_POSITION,
        START_GAME,
        QUIT_ROOM,

        MAX
    }

    public enum ROOM_TYPE
    {
        ROOM_GAME,
        ROOM_MATCH,

        MAX
    }

    [Route("/RoomTezhandui", "POST")]
    public class RoomMessageReq : IReturn<RoomMessageResp>
    {
        public ROOM_CMD cmd { get; set; }
        public int roomId { get; set; }
        public ROOM_TYPE type { get; set; }
        public string usrId { get; set; }
        public int usrPos { get; set; }
        public int sitPos { get; set; }
        public int roomScale { get; set; } // 4人房或6人房
    }

    public class RoomMessageResp
    {
        public Boolean success { get; set; }
        public ROOM_STATE state { get; set; }
        public int countDownTimerCount { get; set; }
        /*public Position pos1 { get; set; }
        public Position pos2 { get; set; }
        public Position pos3 { get; set; }
        public Position pos4 { get; set; }
        public Position pos5 { get; set; }
        public Position pos6 { get; set; }*/
        //public Position[] positions { get; set; }
        public List<Position> positions { get; set; }
        
        public RoomMessageResp()
        {
            success = true;
            state = ROOM_STATE.WAITING;
            countDownTimerCount = 8;
            /*pos1 = null;
            pos2 = null;
            pos3 = null;
            pos4 = null;
            pos5 = null;
            pos6 = null;*/
            //positions = new Position[6];
            positions = new List<Position>();
        }
    }
}
